package org.huangxiaozhe.Test;

import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.media.Ringtone;
import android.media.RingtoneManager;
import android.net.Uri;
import android.os.Bundle;
import android.provider.Settings;
import android.util.Log;
import android.view.Gravity;
import android.view.LayoutInflater;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.AbsoluteLayout;
import android.widget.LinearLayout;
import android.widget.LinearLayout.LayoutParams;
import android.widget.TextView;

public class ChartActivity extends Activity implements OnClickListener {

	@Override
	protected void onPause() {
		// TODO Auto-generated method stub
		super.onPause();
	}

	/** Called when the activity is first created. */
	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);

		Intent intent = this.getIntent();
		if (intent.getBooleanExtra("type", true)) {
			setContentView(R.layout.main2);
			LineChart lc = (LineChart) findViewById(R.id.line_chart);
			int[][] data = { { 8, 3, 7, 13, 5, 45, 1 },
					{ 15, 4, 11, 6, 9, 0, 0 }, { 0, 12, 12, 3, 25, 25, 4 } };
			lc.setData(data);
			lc.setTitle("Points Chart");// */
		} else {
			setContentView(R.layout.main);
			BarChart bc = (BarChart) findViewById(R.id.bar_chart);

			int[][] data = { { 0, 76, 33, 111 }, { 0, 46, 28, 229 },
					{ 4, 45, 34, 16 } };
			bc.setData(data);
			bc.setTitle("Bar Chart");
		}
	}

	@Override
	public void onClick(View v) {

	}

	@Override
	protected void onDestroy() {

		super.onDestroy();
	}

}